import request from '@/utils/request'
//注册接口
export const userRegisterService = (data) => {
  const params=new URLSearchParams()
  for(let key in data){
    params.append(key,data[key])
  }
  return request.post('/user/register',data)
}
// 登录
export const userLoginService = (data) => {
  const params=new URLSearchParams()
  for(let key in data){
    params.append(key,data[key])
  }
  return request.post('/user/login',params)
}
//获取用户的信息
export const userInfoService = () => {
  return request.get('/user/userinfo')
}
//获取用户的信息
export const userUpdateService = (data) => {
  return request.put('/user/update',data)
}
//更新头像
export const userUpdateAvatar=(data)=>{
  const params=new URLSearchParams(data)
  return request.put('/user/updateAvatar',params)
}